# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Maintainer: Jan de Groot <jgc@archlinux.org>
# Contributor: Sarah Hay <sarahhay@mb.sympatico.ca>

pkgname=libgsf
pkgver=1.14.47
pkgrel=1
arch=(x86_64)
pkgdesc="An extensible I/O abstraction library for dealing with structured file formats"
url="https://gitlab.gnome.org/GNOME/libgsf.git"
license=(GPL LGPL)
depends=(libxml2 gdk-pixbuf2 bzip2)
makedepends=(gobject-introspection git gtk-doc autoconf-archive)
checkdepends=(perl-xml-parser unzip) 
_commit=d203263342e21f51fed1c39fec2fd6e9708e6ed8  # tags/LIBGSF_1_14_47^0
source=("git+https://gitlab.gnome.org/GNOME/libgsf.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/^LIBGSF_//;s/_/./g;s/-/+/g'
}

prepare() {
  cd $pkgname
  NOCONFIGURE=1 ./autogen.sh
}

check() {
  cd $pkgname
  make check
}

build() {
  cd "$pkgname"
  PYTHON=/usr/bin/python2 ./configure --prefix=/usr --sysconfdir=/etc \
      --localstatedir=/var --disable-static --enable-introspection --enable-gtk-doc
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

package_libgsf() {
  cd "$pkgname"
  make DESTDIR="$pkgdir" install
}
